A Geographic Exploration of Mental Healthcare
Our Topic
For this project, we chose to continue to explore mental health as we did in our Shiny app. However, while our Shiny app focused exclusively on students, we wanted to expand our target population to include all adults ages 18-39. Additionally, our previous project explored how demographic factors such as age, race, and education affected mental health diagnoses and outcomes; while we are still looking at diagnoses and outcomes here, we wanted to see how incorporating spatial data - specifically state-by-state breakdowns - might lead us to additional insights in these areas.
Our Data
Our data comes from the Substance Abuse and Mental Health Services Administration’s (SAMHSA) Mental Health Client Level Data for 2020. According to SAMHSA, the data “are for individuals receiving mental health treatment services provided or funded through state mental health agencies”. Because of this overall population represented in the dataset, we narrowed it down further to only include those who received at least one primary diagnosis from mental healthcare providers (since it is already an unrepresentative sample in that sense), as well as our age range of 18-39.
Exploring the Data
Mental Health Comorbidities by State
To begin, we created an interactive choropleth exploring how often clients who are diagnosed with one condition are also given additional diagnoses, broken down by US state.
- Certain states have high comorbidity rates regardless of primary diagnosis (e.g. Minnesota, Washington, Virginia), often approaching 80%; however, these states often have low to average comorbidity rates when the primary diagnosis is delirium/dementia, substance use disorders, or developmental disorders.
- Some disorders, like depressive, bipolar, and conduct, appear to have higher comorbidity rates nationwide
- California has a low comorbidity rate across most primary diagnoses even compared to others with similar population. Arkansas’ low comorbidity rate is at an even larger extreme (one of the lowest for every primary diagnosis).
- No real patterns emerge regionally…but could we explore something else to help explain why certain states have higher or lower overall rates of comorbidity?
Additionally, we created a table (https://vchappell.shinyapps.io/ServicesTable/) observing the different health services used by participants which can be filtered by Gender, Employment Status, and Education level, broken down at a state level.
To help understand this table, the different abbreviated services are as follows :
- SPHSERVICE -> State-psychiatric hospital
- CMPSERVICE -> SMHA-funded/operated community-based program
- OPISERVICE -> Other psychiatric inpatient center
- RTCSERVICE -> Residential treatment center
- IJSSERVICE -> Institution under the justice system
The display of this data will eventually be reformatted to display a proportion of the whole such that results are more easily understood, but some preliminary results are:
For nearly every state, there is an inverse relationship between those served by residential treatment centers and institutions under the justice system (i.e., if more are served by an IJS, less are served by a RTC and vice-versa.)
Community-based program services are the most utilized services in each state compared to the other services documented.
In nearly all states, there is a higher sum of men seen in state-psychiatric hospitals, other psychiatric inpatient centers, and institutions under the justice system than women.
Intro
This is an R Markdown blog template. This document will be knit to HTML to produce a webpage that will be hosted publicly via GitHub.
Website publication work flow
Edit Rmd
Knit to HTML to view progress. You may need to click “Open in Browser” for some content to show (sometimes content won’t show until you actually push your changes to GitHub and view the published website).
Commit and push changes when you are ready. The website may take a couple minutes to update automatically after the push, but you may need to clear your browser’s cache or view the page in a private/incognito window to see the changes more quickly.
Content
You can include text, code, and output as usual.
Remember to take full advantage of Markdown and follow our Style
Guide.
Examples and additional guidance are provided below.
Take note of the the default code chunk options in the
setup code chunk. For example, unlike the rest of the Rmd
files we worked in this semester, the default code chunk option is
echo = FALSE, so you will need to set
echo = TRUE for any code chunks you would like to display
in the blog. You should be thoughtful and intentional about the code you
choose to display.
Links
You can include links using Markdown syntax as shown.
You should include links to relevant sites as you write. You should additionally include a list of references as the end of your blog with full citations (and relevant links).
Visualizations
Visualizations, particularly interactive ones, will be well-received. That said, do not overuse visualizations. You may be better off with one complicated but well-crafted visualization as opposed to many quick-and-dirty plots. Any plots should be well-thought-out, properly labeled, informative, and visually appealing.
If you want to include dynamic visualizations or tables, you should explore your options from packages that are built from htmlwidgets. These htmlwidgets-based packages offer ways to build lighterweight, dynamic visualizations or tables that don’t require an R server to run! A more complete list of packages is available on the linked website, but a short list includes:
- plotly: Interactive graphics with D3
- leaflet: Interactive maps with OpenStreetMap
- dygraphs: Interactive time series visualization
- visNetwork: Network graph visualization vis.js
- sparkline: Small inline charts
- threejs: Interactive 3D graphics
You may embed a published Shiny app in your blog if useful, but be aware that there is a limited window size for embedded objects, which tends to makes the user experience of the app worse relative to a dedicated Shiny app page. Additionally, Shiny apps will go idle after a few minutes and have to be reloaded by the user, which may also affect the user experience.
Any Shiny apps embedded in your blog should be accompanied by the link to the published Shiny app (I did this using a figure caption in the code chunk below, but you don’t have to incorporate the link in this way).
Tables
DT package
The DT package is great for making dynamic tables that can be displayed, searched, and filtered by the user without needing an R server or Shiny app!
Note: you should load any packages you use in the setup
code chunk as usual. The library() functions are shown
below just for demonstration.
library(DT)
mtcars %>%
select(mpg, cyl, hp) %>%
datatable(colnames = c("MPG", "Number of cylinders", "Horsepower"),
filter = 'top',
options = list(pageLength = 10, autoWidth = TRUE))kableExtra package
You can also use kableExtra for customizing HTML tables.
library(kableExtra)
summary(cars) %>%
kbl(col.names = c("Speed", "Distance"),
row.names = FALSE) %>%
kable_styling(bootstrap_options = "striped",
full_width = FALSE) %>%
row_spec(0, bold = TRUE) %>%
column_spec(1:2, width = "1.5in") | Speed | Distance |
|---|---|
| Min. : 4.0 | Min. : 2.00 |
| 1st Qu.:12.0 | 1st Qu.: 26.00 |
| Median :15.0 | Median : 36.00 |
| Mean :15.4 | Mean : 42.98 |
| 3rd Qu.:19.0 | 3rd Qu.: 56.00 |
| Max. :25.0 | Max. :120.00 |
Images
Images and gifs can be displayed using code chunks:
“Safe Space” by artist Kenesha Sneed
This is a figure caption
You may also use Markdown syntax for displaying images as shown below, but code chunks offer easier customization of the image size and alignment.